﻿@model Ecommerce.Areas.Home.Models.HomeModel
<div id="detailProd">
    <img src="/Upload/prodImg/@Model.Product.ImgThum" width="250" height="140" />
    <div class="detail">
        <div class="header">
            <div class="title">@Html.DisplayFor(model => model.Product.ProdName)</div>
            <div style="float: right;">
                <div class="price">@Html.DisplayFor(model => model.Product.Price)$&nbsp;&nbsp;</div>
                <div class="button" id="btnPrice">Add to cart</div>
            </div>
        </div>
        <p>
            @Html.DisplayFor(model => model.Product.Description)
        </p>
    </div>
</div>
<div id="ProdImgList">
    <hr />
    @foreach (string img in Model.ImageList)
    {
        <a href="/Upload/prodImg/@img" target="_blank">
            <img src="/Upload/prodImg/@img" width="800" title="Click here to large image" /><br />
            <br />
        </a>
    }
</div>
@using (Html.BeginForm("AddCart", "Cart", new { productID = Model.Product.ProductID }, FormMethod.Post, new { @id = "frmCart" }))
{
    @Html.HiddenFor(model => model.Product.ProductID)
}

<script type="text/javascript">
    $(document).ready(function () {
        $("#btnPrice").click(function () {

            $("#frmCart").submit();
        })
    });
</script>
